<template>
  <t-tag v-if="dictType">
    {{ getDictLabel(statusStr, dictType) }}
  </t-tag>
  <!-- @vue-ignore -->
  <t-tag v-else-if="statusItem" :theme="statusItem.theme" variant="light">{{ statusItem.label }}</t-tag>
</template>

<script setup lang="ts">
  import { COMMON_STATUS } from '@/constants/common'

  const props = defineProps({
    status: {
      type: [Number, String],
      default: '0',
      required: true
    },
    dictType: {
      type: String,
      required: false
    }
  })

  const { status } = toRefs(props);

  const statusStr = computed(() => {
    return String(status.value);
  })

  const statusItem = computed(() => {
    return COMMON_STATUS.find(item => item.value === statusStr.value);
  })

  const getDictLabel = (statusStr: string, _dictType: string) => {

    return statusStr;
  }

</script>

<style scoped lang="less"></style>
